/*
 * by cansik / Florian
 * Datum: 28.05.2009
 * Zeit: 14:09
 * 
 *
 */
using System;
using ProviderHandler;
using System.Collections.Generic;

namespace sEmit.Core
{
	/// <summary>
	/// Description of FavoritenListe.
	/// </summary>
	public class FavoritenListe
	{
		public int Size {get; set;}
		List<Contact> contacts;
		
		public FavoritenListe(int size)
		{
			Size = size;
			contacts = new List<Contact>();
		}
		
		public void Add(Contact c)
		{
			if (contacts.Contains(c) == false)
			{
				contacts.Add(c);
				if (contacts.Count > Size)
				{
					contacts.RemoveAt(0);
				}
			}
		}
		
		public Contact[] Contacts
		{
			get
			{
				return contacts.ToArray();
			}
		}
	}
}
